# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-readme-renderer
pkgver=37.3
pkgrel=3
pkgdesc="Safely render long_description/README files in Warehouse"
url="https://github.com/pypa/readme_renderer"
license=('Apache')
arch=('any')
depends=('python-bleach' 'python-docutils' 'python-pygments' 'python-six')
optdepends=('python-cmarkgfm: for Markdown support')
makedepends=('python-setuptools' 'python-cmarkgfm')
checkdepends=('python-pytest-runner')
source=(https://github.com/pypa/readme_renderer/archive/$pkgver/$pkgname-$pkgver.tar.gz)
sha512sums=('1de7156d138a6f3bacf37af8e3b17b8b70cf42c39edbebe21e29dea0d9b521b8139ca8f053b28d8fc50b4e4ce21de79c262e4e529c7f14d771fd7417630da18e')

build() {
  cd readme_renderer-$pkgver
  python setup.py build
}

check() {
  cd readme_renderer-$pkgver
  python setup.py pytest || echo "Tests failed"
}

package_python-readme-renderer() {
  cd readme_renderer-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
}
